
const { exec } = require('../db/mysql')
/* 

登录需要有：用户名（username）和密码(password)

*/
const loginCheck = (username,password) => {
    // if(username === 'zhangsan' && password === '123'){
    //     return true
    // }else{
    //     return false
    // }
    const sql = `select username,realname from user where username = '${username}' and password = '${password}'`
    return exec(sql).then(rows => {
        return rows[0] || {}
    })
}


module.exports = {
    loginCheck
}